package ch.fhnw.qualiscan.application.modals;

import java.util.List;

import ch.fhnw.qualiscan.application.models.DomainModel;
import ch.fhnw.qualiscan.core.Modal;
import ch.fhnw.qualiscan.core.db.pojos.Domain;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;

import eu.livotov.tpt.i18n.TM;

public class DomainHelper extends Modal {
	
	private DomainModel domainModel;
	private List<Domain> domainList;
	private Button cancelButton;
	
	public DomainHelper() {
		this.setCaption(TM.get("domainhelper.title"));
		domainModel = new DomainModel();
		domainList = domainModel.getDomains();
		
		buildLayout();
	}
	
	public void buildLayout() {
		
		for (int d = 0; d < domainList.size(); d++) {
			Label title = textHelper.span("<strong>"+domainModel.getDomainText(domainList.get(d), userSession.getLanguage()).getText()+"</strong>");
			Label text = textHelper.p(domainModel.getDomainDescription(domainList.get(d), userSession.getLanguage()).getText());
			this.addComponent(title);
			this.addComponent(text);
		}

	}
}
